<?php
$dis_id=3;
include("../../inc/conn.inc");
include("../islogin2.php");
if($_POST[act]){
 $_POST["news_title"]=delwords($_POST["news_title"]);
  $_POST["news_content"]=delwords($_POST["news_content"]);
$type_id=explode("@",$_POST[type_id]);
$p_rs=@mysql_query("select * from city where id='$_POST[c_provinces]' and city_id=0");
$p_row=@mysql_fetch_array($p_rs);
$c_rs=@mysql_query("select * from city where id='$_POST[c_city]' and c_dj=2");
$c_row=@mysql_fetch_array($c_rs);
$c_city=($_POST[c_city])?$_POST[c_city]:0;
$n_sh=$_POST[n_sh]?$_POST[n_sh]:0;
$n_tj=$_POST[n_tj]?$_POST[n_tj]:0;
mysql_query("insert into news (member_id,news_title,type_id,type_name,type_id2,type_name2,pro_id,pro_name,city_id,city_name,news_content,news_time) values ('".$_COOKIE['user_id']."','$_POST[news_title]','1','三帝招标','$type_id[0]','$type_id[1]','$_POST[c_provinces]','$p_row[city_name]','$c_city','$c_row[city_name]','$_POST[news_content]','".date("Y-m-d H:i:s")."')");


echo "<script>alert('发布成功');location='zhaobiao.php'</script>";

}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<script language="javascript" src="/js/city.js" type="text/javascript" charset="gb2312"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 招标 &gt;&gt; 发布招标信息</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">发布招标信息</TD>
   </TR>
</TABLE>
<br>

<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C1DCF5">
<form method="post" action="" onSubmit="return checkform()" name="form1">
  <tr>
    <td width="17%" height="25" align="center" bgcolor="#EFF6FF">招标主题</td>
    <td width="83%" bgcolor="#FFFFFF" style="padding-left:4px;"><input name="news_title" type="text" size="60"></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#EFF6FF">招标分类</td>
	<td bgcolor="#FFFFFF" style="padding-left:4px;">
<select name="type_id" id="type_id">
<option value="">--选择招标分类--</option>    
<?    
$t_rs= mysql_query("select * from news_type where type_id=1");    
while($t_row=mysql_fetch_array($t_rs)){    
?>    
<option value="<?=$t_row[id]?>@<?=$t_row[type_name]?>"><?=$t_row[type_name]?></option> 
<? } ?>    
</select></td>
  </tr>
    <tr>
    <td height="25" align="center" bgcolor="#EFF6FF">选择城市</td>
	<td bgcolor="#FFFFFF" style="padding-left:4px;"><select name="c_provinces" onChange="changecity(document.form1.c_provinces.options[document.form1.c_provinces.selectedIndex].value)">
<option value="">--选择省份--</option>    
<?    
$rs01=@mysql_query("select * from city where city_id=0 order by order_name asc");    
while($res=@mysql_fetch_array($rs01)){    
?>    
<option value="<?=$res['id']?>"><?=$res['city_name']?></option> 
<? } ?>    
</select>     
<select name="c_city" id="c_city">                    
  <option value="">--选择城市--</option>
</select></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#EFF6FF">详细内容</td>
    <td bgcolor="#FFFFFF" style="padding-left:4px;"><textarea name="news_content" style="display:none"></textarea><IFRAME ID="eWebEditor1" SRC="/editor/ewebeditor.htm?id=news_content&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="400"></IFRAME></td>
  </tr>
  <tr><input type="hidden" name="act" value="sandib2b.cn">
    <td height="25" colspan="2" align="center" bgcolor="#EFF6FF"><input type="submit" value="提交"></td>
    </tr>
  </form>
</table>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");
?>
</div>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
  if($("news_title").value==""){
     alert("招标主题不能为空");
     $("news_title").focus();
     return false;
}
if($("type_id").value==""){
     alert("招标分类不能为空");
     $("type_id").focus();
     return false;
}
if($("c_provinces").value==""){
     alert("省份不能为空");
     $("c_provinces").focus();
     return false;
}
if($("c_city").value==""){
     alert("城市不能为空");
     $("c_city").focus();
     return false;
} 
 
 
}
</script>